<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<!-- <link rel="stylesheet" href="./base.css"> -->
<style>
    * {
        padding: 0;
        list-style: none;
    }

    body {
        perspective: 1000px;
    }

    ul {
        margin: 100px auto;
        height: 300px;
        width: 300px;
        position: relative;
        transform-style: preserve-3d;
        /* transition: all 0.1s; */
    }

    ul:hover {
        /* transform: rotateX(360deg) rotateY(360deg); */
    }

    li {
        position: absolute;
        width: 100%;
        height: 100%;
        background-size: 100% 100%;
    }

    ul li:nth-child(1) {
        background-color: red;
        transform: rotateX(0deg) translateZ(180px);
        background-size:cover;
        background-image: url("./images/1.jpg");
    }

    ul li:nth-child(2) {
        background-color: yellow;
        transform: rotateX(90deg) translateZ(180px);
        background-size:cover;
        background-image: url("./images/2.jpg");
    }

    ul li:nth-child(3) {
        background-color: pink;
        transform: rotateX(180deg) translateZ(180px);
        background-size:cover;
        background-image: url("./images/3.jpg");
    }

    ul li:nth-child(4) {
        background-color: blue;
        transform: rotateX(270deg) translateZ(180px);
        background-size:cover;
        background-image: url("./images/4.jpg");
    }

    ul li:nth-child(5) {
        background-color: skyblue;
        transform: rotateY(-90deg) translateZ(180px);
        background-size:cover;
        background-image: url("./images/5.jpg");
    }

    ul li:nth-child(6) {
        background-color: #ccc;
        transform: rotateY(90deg) translateZ(180px);
        background-size:cover;
        background-image: url("./images/6.jpg");
    }
</style>

<body>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</body>
<script>
    var x = 0
    var y = 0
    var time1 = setInterval(() => {
        x += 1
        y += 1
        if (x == 360) {
            x = 0
            y = 0
        }
        document.querySelector("ul").style.transform = `rotateX(${x}deg) rotateY(${y}deg)`

    }, 10);


</script>

</html>
